# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-wasabi
pkgver=1.1.2
pkgrel=1
pkgdesc="A lightweight console printing and formatting toolkit"
url="https://github.com/explosion/wasabi"
arch="noarch"
license="MIT"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="jupyter-nbconvert py3-ipykernel py3-pytest"
subpackages="$pkgname-doc $pkgname-pyc"
source="wasabi-$pkgver.tar.gz::https://github.com/explosion/wasabi/archive/v$pkgver.tar.gz"
builddir="$srcdir/wasabi-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}

sha512sums="
63b1e098dfe169986454711f76bb787a191b7888ac560f71ff6a1c64ab071d2b20b10b11cacab12c0f1b23162f50d3de702dc70b48fefe04b1013397fccfc010  wasabi-1.1.2.tar.gz
"
